﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using Sita.Entities.MetaData.CustomAttributes;

namespace Sita.Entities.MetaData
{
    public class Replacement
    {
        [ScaffoldColumn(false)]
        public object ReplacementID { get; set; }

        [ScaffoldColumn(false)]
        public object BusinessUnitID { get; set; }

        [LocalizedDisplayName("Code", ResourceType = typeof(Resources.Replacement))]
        [StringLength(15, ErrorMessageResourceType = typeof(Resources.Replacement), ErrorMessageResourceName = "CodeMaxLength")]
        [DataType(DataType.Text)]
        public object Code { get; set; }

        [Required(ErrorMessageResourceType = typeof(Resources.Replacement), ErrorMessageResourceName = "NameRequired")]
        [LocalizedDisplayName("Name", ResourceType = typeof(Resources.Replacement))]
        [StringLength(100, ErrorMessageResourceType = typeof(Resources.Replacement), ErrorMessageResourceName = "NameMaxLength")]
        [DataType(DataType.Text)]
        public object Name { get; set; }

        [LocalizedDisplayName("Provider", ResourceType = typeof(Resources.Replacement))]
        [DataType(DataType.Text)]
        public object ProviderID { get; set; }

        [LocalizedDisplayName("Brand", ResourceType = typeof(Resources.Replacement))]
        [DataType(DataType.Text)]
        public object ReplacementBrandID { get; set; }

        [LocalizedDisplayName("Stock", ResourceType = typeof(Resources.Replacement))]
        [Range(0, int.MaxValue, ErrorMessageResourceType = typeof(Resources.Replacement), ErrorMessageResourceName = "StockIsNumeric")]
        public object Stock { get; set; }

        [LocalizedDisplayName("MinimumStock", ResourceType = typeof(Resources.Replacement))]
        [Range(0, int.MaxValue, ErrorMessageResourceType = typeof(Resources.Replacement), ErrorMessageResourceName = "MinimumStockIsNumeric")]
        public object MinimumStock { get; set; }

        [LocalizedDisplayName("PoundPrice", ResourceType = typeof(Resources.Replacement))]
        [RegularExpression(@"^([0-9]{0,7})(\.[0-9]{1,2})?$", ErrorMessageResourceType = typeof(Resources.Replacement), ErrorMessageResourceName = "PoundPriceInvalid")]
        public object PoundPrice { get; set; }

        [LocalizedDisplayName("DollarPrice", ResourceType = typeof(Resources.Replacement))]
        [RegularExpression(@"^([0-9]{0,7})(\.[0-9]{1,2})?$", ErrorMessageResourceType = typeof(Resources.Replacement), ErrorMessageResourceName = "DollarPriceInvalid")]
        public object DollarPrice { get; set; }

        [LocalizedDisplayName("ArgPrice", ResourceType = typeof(Resources.Replacement))]
        [RegularExpression(@"^([0-9]{0,7})(\.[0-9]{1,2})?$", ErrorMessageResourceType = typeof(Resources.Replacement), ErrorMessageResourceName = "ArgPriceInvalid")]
        public object ArgPrice { get; set; }

        [LocalizedDisplayName("ProfitPercentage", ResourceType = typeof(Resources.Replacement))]
        [RegularExpression(@"^([0-9]{0,7})(\.[0-9]{1,2})?$", ErrorMessageResourceType = typeof(Resources.Replacement), ErrorMessageResourceName = "ProfitPercentageInvalid")]
        public object ProfitPercentage { get; set; }

        [LocalizedDisplayName("PublicPrice", ResourceType = typeof(Resources.Replacement))]
        [RegularExpression(@"^([0-9]{0,7})(\.[0-9]{1,2})?$", ErrorMessageResourceType = typeof(Resources.Replacement), ErrorMessageResourceName = "PublicPriceInvalid")]
        public object PublicPrice { get; set; }

        [LocalizedDisplayName("IVAPrice", ResourceType = typeof(Resources.Replacement))]
        [RegularExpression(@"^([0-9]{0,7})(\.[0-9]{1,2})?$", ErrorMessageResourceType = typeof(Resources.Replacement), ErrorMessageResourceName = "IVAPriceInvalid")]
        public object IVAPrice { get; set; }

        [LocalizedDisplayName("ShelfLocation", ResourceType = typeof(Resources.Replacement))]
        [StringLength(10, ErrorMessageResourceType = typeof(Resources.Replacement), ErrorMessageResourceName = "ShelfLocationMaxLength")]
        [DataType(DataType.Text)]
        public object ShelfLocation { get; set; }
        
        [LocalizedDisplayName("RowLocation", ResourceType = typeof(Resources.Replacement))]
        [StringLength(10, ErrorMessageResourceType = typeof(Resources.Replacement), ErrorMessageResourceName = "RowLocationMaxLength")]
        [DataType(DataType.Text)]
        public object RowLocation { get; set; }

        [LocalizedDisplayName("ColumnLocation", ResourceType = typeof(Resources.Replacement))]
        [StringLength(10, ErrorMessageResourceType = typeof(Resources.Replacement), ErrorMessageResourceName = "ColumnLocationMaxLength")]
        [DataType(DataType.Text)]
        public object ColumnLocation { get; set; }

        [LocalizedDisplayName("CodeExtra1", ResourceType = typeof(Resources.Replacement))]
        [StringLength(15, ErrorMessageResourceType = typeof(Resources.Replacement), ErrorMessageResourceName = "CodeExtra1MaxLength")]
        [DataType(DataType.Text)]
        public object CodeExtra1 { get; set; }

        [LocalizedDisplayName("CodeExtra2", ResourceType = typeof(Resources.Replacement))]
        [StringLength(15, ErrorMessageResourceType = typeof(Resources.Replacement), ErrorMessageResourceName = "CodeExtra2MaxLength")]
        [DataType(DataType.Text)]
        public object CodeExtra2 { get; set; }

        [LocalizedDisplayName("LastPurchaseDate", ResourceType = typeof(Resources.Replacement))]
        [DataType(DataType.Date)]
        public object LastPurchaseDate { get; set; }

        [LocalizedDisplayName("LastSellDate", ResourceType = typeof(Resources.Replacement))]
        [DataType(DataType.Date)]
        public object LastSellDate { get; set; }
    }
}
